import { apiPrefix } from '@/consts/consts'

export default ({ $service:request }) => ({
  // 4.9.1. 通知列表
  notificationList(params) {
    return request({
      url: `${apiPrefix}/api/v1/notification/list`,
      method: 'post',
      params
    })
  },

  // 4.9.2. 新增通知
  notificationAdd(data) {
    return request({
      url: `${apiPrefix}/api/v1/notification/add`,
      method: 'post',
      data
    })
  },
  
  // 4.9.3. 修改通知
  notificationUpdate(data, id) {
    return request({
      url: `${apiPrefix}/api/v1/notification/update/${id}`,
      method: 'put',
      data
    })
  },
  
  // 4.9.4. 删除通知
  notificationDelete(id) {
    return request({
      url: `${apiPrefix}/api/v1/notification/delete/${id}`,
      method: 'delete',
    })
  },
  
  // 4.9.5. 发送通知
  notificationSend(data) {
    return request({
      url: `${apiPrefix}/api/v1/notification/send`,
      method: 'post',
      data
    })
  },
})
